<template>
  <div>
    <x-header :left-options="{showBack: false}">账号注册</x-header>
    <group label-width="85px">
      <x-input title="身份证号" v-model="id_number"></x-input>
      <x-input title="姓名"></x-input>
      <x-input type="password" title="密码"></x-input>
      <x-input type="password" title="重复密码"></x-input>
      <x-input type="tel" title="手机号" :max="11"></x-input>
      <x-input title="验证码">
        <x-button slot="right" type="primary" mini>获取短信验证码</x-button>
      </x-input>
    </group>
    <div style="padding: 15px">
      <x-button type="primary" @click.native="onSubmit">注册</x-button>
    </div>
  </div>
</template>

<script>
  import {XHeader, Group, XInput, XButton} from 'vux'

  export default {
    components: {
      XHeader,
      Group,
      XInput,
      XButton
    },
    data() {
      return {
        id_number: '',
        name: '',
        password: '',
        tel: ''
      }
    },
    methods: {
      onSubmit() {
        if (!this.id_number) {
          this.$vux.toast.text('信息填写不全')
          return
        }
        this.$router.push({name: 'JoinSuccess'})
      }
    }
  }
</script>
